﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SignUpList.aspx.cs" Inherits="E.Web.Teacher.classes.SignUpList" %>
<%@ Import Namespace="E.Model" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
  <title>班级列表</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  <link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
  <link rel="stylesheet" href="/css/t_main.css" type="text/css" media="all" />
  <link rel="stylesheet" href="/css/class.css" type="text/css" media="all" />
  <link rel="stylesheet" href="/css/flora.datepick.css" type="text/css" media="all" />
  <script type="text/javascript" src="/js/Common.js"></script>
  <script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
  <script type="text/javascript" src="/js/jquery.datepick.min.js"></script>
  <script type="text/javascript" src="/js/jquery.datepick-zh-CN.js"></script>
   <link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
  <link rel="stylesheet" href="/css/t_main.css" type="text/css" media="all" />
  <link href="/js/jquery-window-5.03/css/jquery.window.css" rel="stylesheet" type="text/css"/>
  <script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js" type="text/javascript"></script>
  <script type="text/javascript" src="/js/jquery-window-5.03/jquery.window.js"> </script>
  <link href="/js/jquery-window-5.03/css/jquery.window.css" rel="stylesheet" type="text/css"/>

      <style type="text/css">
        a{color:#333;text-decoration:none;font-size:10pt;cursor:pointer; } 
        a:hover {color:#CC3300;text-decoration:underline;font-size:10pt;}
        #ui-datepicker-div {
          z-index: 9999999!important;
        }
    </style>
   <style type="text/css">
        a
        {
            color: #333;
            text-decoration: none;
            font-size: 10pt;
            cursor: pointer;
        }
        a:hover
        {
            color: #CC3300;
            text-decoration: underline;
            font-size: 10pt;
        }
        #ui-datepicker-div
        {
            z-index: 9999999 !important;
        }
    </style>
  <script type="text/javascript">
      $(document).ready(
      function () {
          $("#StartFromDateTxt").datepick({ dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: '/images/icon/calendar-green.gif', buttonImageOnly: true });
          $("#StartToDateTxt").datepick({ dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: '/images/icon/calendar-green.gif', buttonImageOnly: true });
          $("#EndFromDateTxt").datepick({ dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: '/images/icon/calendar-green.gif', buttonImageOnly: true });
          $("#EndToDateTxt").datepick({ dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: '/images/icon/calendar-green.gif', buttonImageOnly: true });
      }
    );
      var windowObj;
      function Permit(userIDs, classID, courseID, classCode) {
         
          var url = "/tools/ajax.aspx?t=getUserInfoByUserID&studentIds=" + userIDs;
          var data = "&studentIds12=" + userIDs;
          $("#classCode").attr("value", classCode);
          $("#classID").attr("value", classID);
          $("#courseID").attr("value", courseID);
          $.ajax({
              url: url,
              data: data,
              aync: true,
              datatype: "text",
              type: "post",
              async: true,
              success: function (jsondata) {

                  openStudentListWindow(jsondata);
              }
          });
      }

      function openStudentListWindow(jsondata) {
          var searchResult = $("<div id='searchResult'></div>");
          var table = $("<table id='tableSearchResult'></table>");
          table.appendTo(searchResult);
          var eachStudent;
          for (var i = 0; i < jsondata.length; i++) {
              eachStudent = jsondata[i];
              $("<tr><td class='ContentCell'><input type='checkbox' name='studentId' value='" + eachStudent.ID + "'/></td><td class='ContentCell'>" + eachStudent.UserName + "</td></tr>").appendTo(table);
          }
          var btnDiv = $("<div style='float:left;'></div>");
          btnDiv.appendTo(searchResult);
          $("<a id='btnAll' name='btnAll' onclick=\"selectAll('tableSearchResult');\">全选&nbsp;&nbsp;</a>").appendTo(btnDiv);
          $("<a id='btnInverse' name='btnInverse' onclick=\"inverseAll('tableSearchResult');\">反选&nbsp;&nbsp;</a>").appendTo(btnDiv);
          $("<a id='btnConfirm' name='btnConfirm' onclick=\"confirmStudentArrayId();\">确定</a>").appendTo(btnDiv);
          $.window({
              //modalOpacity: 0.5,
              title: "审核报名学生",
              content: searchResult, // load window_block2 html content
              draggable: true,
              resizable: true,
              minimizable: false,
              maximizable: false,
              showModal: true
          });
      }
      function confirmStudentArrayId() {

          var idArray = '';
          var allSelectControl = $("#tableSearchResult input[type='checkbox']");

          $.each(allSelectControl, function (n, value) {

              if (value.checked == true) {
                  idArray = idArray + value.value + ";";
              }
          });
          $("#studentIdArray").attr("value", idArray.substring(0, idArray.length - 1));
          document.getElementById("form1").action = "?act=h";
          document.getElementById("form1").submit();
      }
  </script>
</head>
<body>
  <form id="form1" action="?act=s" method="post">
    <div class="m_top"></div>
    <div class="block">
      <div style="width:650px; height:22px;">
        <div class="title">&nbsp;搜索条件</div>
      </div>
      <div class="spe_line_2"></div>
      <div style="width:650px; height:23px; margin-top:6px;">
        <div class="fl" style="line-height:23px;">班级编号：</div>
        <div class="fl"><input type="text" id="ClassCodeTxt" name="ClassCodeTxt" value="<%=classCode %>" /></div>
        <div class="fl" style="line-height:23px;">&nbsp;课程名称：</div>
        <div class="fl"><input type="text" id="CourseName" name="CourseName" value="<%=courseName %>" /></div>
      </div>
      <div style="width:650px; height:23px; margin-top:6px;">
        <div class="fl" style="line-height:23px;">课程类别：</div>
        <div class="fl">
          <select id="CourseCategorySlt" name="CourseCategorySlt">
            <option value="-1">全部</option>
            <% if (cc_list != null && cc_list.Count > 0) { %>
              <% foreach (CourseCategoryModel model in cc_list) { %>
            <option value="<%=model.ID %>"><%=model.Name%></option>
              <% } %>
            <% } %>
          </select>
        </div>
        <div class="fl" style="line-height:23px;">&nbsp;地点：</div>
        <div class="fl">
          <select id="AreaSlt" name="AreaSlt">
            <option value="-1">全部</option>
            <% if (areaList != null && areaList.Count > 0) { %>
              <% foreach (DictAreaModel model in areaList) { %>
            <option value="<%=model.ID %>"><%=model.Name%></option>
              <% } %>
            <% } %>
          </select>
        </div>
      </div>
      <div style="width:650px; height:23px; margin-top:6px;">
        <div class="fl" style="line-height:23px;">开始时间：</div>
        <div class="fl"><input id="StartFromDateTxt" name="StartFromDateTxt" value="<%=startFromDate %>" />&nbsp;至&nbsp;<input id="StartToDateTxt" name="StartToDateTxt" value="<%=startToDate %>" /></div>
      </div>
      <div style="width:650px; height:23px; margin-top:6px;">
        <div class="fl" style="line-height:23px;">结束时间：</div>
        <div class="fl"><input id="EndFromDateTxt" name="EndFromDateTxt" value="<%=endFromDate %>" />&nbsp;至&nbsp;<input id="EndToDateTxt" name="EndToDateTxt" value="<%=endToDate %>" /></div>
        <div class="fl"><input type="image" src="/images/btn/search.gif" style="width:54px; height:23px; margin-left:20px;" /></div>
      </div>
    </div>
    
    <div class="block_2" style="height:340px; display:table;">
      <div style="width:650px; height:22px;">
        <div class="title">&nbsp;搜索结果</div>
      </div>
      <div class="spe_line_2"></div>
      
      <% if (classList != null && classList.Count > 0) { %>
    
      <div id="datatable">
        <div class="data_rows" style="font-weight:bolder;">
          <div class="d_r_i">ID</div>
          <div class="d_r_cd">班级编号</div>
          <div class="d_r_e">课程</div>
          <div class="d_r_c">类别</div>
          <div class="d_r_a">地点</div>
          <div class="d_r_d">开班时间</div>
          <div class="d_r_o">操作</div>
        </div>
        
         <% foreach (ShortClassModel model in classList) { %>
        <div class="data_rows">
          <div class="d_r_i"><%=model.ID%></div>
          <div class="d_r_cd"><%=model.ClassCode%></div>
          <div class="d_r_e"><%=model.CourseName%></div>
          <div class="d_r_c"><%=model.CourseCategoryName%></div>
          <div class="d_r_a"><%=model.AreaName%></div>
          <div class="d_r_d"><%=model.StartTime.ToString("yyyy.MM.dd") %>-<%=model.EndTime.ToString("yyyy.MM.dd")%></div>
          <div class="d_r_o"><a id="hrefPermit" onclick="Permit('<%=model.UserIDArr %>',<%=model.ID %>,<%=model.CourseRelationID %>,'<%=model.ClassCode %>')">审核</a></div>
        </div>
      
         <% } %>
        
      </div>
      
      <div class="fr" style="margin:8px 0 0 0;"><%=mypager%></div>
      
      <%} %>
    </div>
     <input type="hidden" name="studentIdArray" id="studentIdArray" />
    <input type="hidden" name="classCode" id="classCode" />
    <input type="hidden" name="courseID" id="courseID" />
    <input type="hidden" name="classID" id="classID" />
  </form>
  <script type="text/javascript">
  <% if (areaid != -1){ %>
  document.getElementById("AreaSlt").value = <%=areaid %>;
  <% } %>
  <% if (categoryid != -1){ %>
  document.getElementById("CourseCategorySlt").value = <%=categoryid%>;
  <% } %>
  </script>
</body>
</html>
